<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../static/header.jsp" %>
<c:if test="${!ajaxRequest}">
	brak ajax
</c:if>

	<div id="fileupload">
            
		<h2>File Upload</h2>
		<p>
			See the <code>org.springframework.samples.mvc.fileupload</code> package for the @Controller code	
		</p>
                
		<form id="fileuploadForm" action="fileupload.htm" method="POST" enctype="multipart/form-data" class="cleanform">
		  		
		  		<c:if test="${not empty message}">
					<div id="message" class="${message.type}">${message.text}</div>	  		
		  		</c:if>
			
			<label for="file">File</label>
			<input id="file" type="file" name="file" />
			<p><button type="submit">Upload</button></p>		
		</form>
                
                
		<script type="text/javascript">
                    
			$(document).ready(function() {
				$('<input type="hidden" name="ajaxUpload" value="true" />').insertAfter($("#file"));
				$("#fileuploadForm").ajaxForm({ success: function(html) {
						$("#fileupload").replaceWith(html);
					}
				});
			});
                        
		</script>
                
	</div>
        
<c:if test="${!ajaxRequest}">

</c:if>

<!-- END LOGIN -->
<%@include file="../static/footer.jsp" %>